package com.shujia.flink.source

import org.apache.flink.streaming.api.scala.{DataStream, StreamExecutionEnvironment}

object Demo3SocketSource {
  def main(args: Array[String]): Unit = {
    //创建flink环境
    val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment

    /**
     * 3  基于socket 构建DataStream  -- 无界流
     */
    val socketDS: DataStream[String] = env.socketTextStream("master", 8888)

    socketDS.print()

    env.execute()

  }

}
